Handle tab_label being NULL better. (#341455, William Jon McCann, patch by
authorMatthias Clasen <mclasen@redhat.com>
Sat, 13 May 2006 02:56:04 +0000 (02:56 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sat, 13 May 2006 02:56:04 +0000 (02:56 +0000)
2006-05-12  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtknotebook.c: Handle tab_label being NULL better.
(#341455, William Jon McCann, patch by Carlos Garnacho Parro)

ChangeLog
ChangeLog.pre-2-10
gtk/gtknotebook.c

index 0445a5a62cab0f3182094eec7bfc8ea4eef82978..8510093fa6ac6514129cac6ce75c908a33cea111 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-05-12  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtknotebook.c: Handle tab_label being NULL better.
+       (#341455, William Jon McCann, patch by Carlos Garnacho Parro)
+
        * gtk/gtkruler.c: Reinstate the ruler metrics strings, since
        they are used by glade, pointed out by Damon Chaplin.
 
index 0445a5a62cab0f3182094eec7bfc8ea4eef82978..8510093fa6ac6514129cac6ce75c908a33cea111 100644 (file)
@@ -1,5 +1,8 @@
 2006-05-12  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtknotebook.c: Handle tab_label being NULL better.
+       (#341455, William Jon McCann, patch by Carlos Garnacho Parro)
+
        * gtk/gtkruler.c: Reinstate the ruler metrics strings, since
        they are used by glade, pointed out by Damon Chaplin.
 
index 7b336494e67f955ddb8827f356d37121940cb9b4..fb823ef34dd0d7fc37a31f9fe03655bba1105a10 100644 (file)
@@ -124,7 +124,7 @@ enum {
 #define PAGE_TOP_Y(_page_)    (((GtkNotebookPage *) (_page_))->allocation.y)
 #define PAGE_BOTTOM_Y(_page_) (((GtkNotebookPage *) (_page_))->allocation.y + ((GtkNotebookPage *) (_page_))->allocation.height)
 #define PAGE_MIDDLE_Y(_page_) (((GtkNotebookPage *) (_page_))->allocation.y + ((GtkNotebookPage *) (_page_))->allocation.height / 2)
-#define NOTEBOOK_IS_TAB_LABEL_PARENT(_notebook_,_page_) ((_page_)->tab_label != NULL && ((GtkNotebookPage *) (_page_))->tab_label->parent == ((GtkWidget *) (_notebook_)))
+#define NOTEBOOK_IS_TAB_LABEL_PARENT(_notebook_,_page_) (((GtkNotebookPage *) (_page_))->tab_label->parent == ((GtkWidget *) (_notebook_)))
 
 struct _GtkNotebookPage
 {
@@ -4303,7 +4303,8 @@ gtk_notebook_search_page (GtkNotebook *notebook,
          page = list->data;
          if (page->pack == flag &&
              (!find_visible ||
-              (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) && GTK_WIDGET_VISIBLE (page->child))))
+              (GTK_WIDGET_VISIBLE (page->child) &&
+               (!page->tab_label || NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page)))))
            return list;
          old_list = list;
          list = list->next;
@@ -4320,7 +4321,8 @@ gtk_notebook_search_page (GtkNotebook *notebook,
       page = list->data;
       if (page->pack != flag &&
          (!find_visible ||
-          (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) && GTK_WIDGET_VISIBLE (page->child))))
+          (GTK_WIDGET_VISIBLE (page->child) &&
+           (!page->tab_label || NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page)))))
        return list;
       old_list = list;
       list = list->prev;